﻿<Window x:Class="WIN_UML_Editor.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:WIN_UML_Editor"
        Title="UML Activity Diagram Maker" Height="600" Width="800"
        Icon="favicon.ico">
    <Window.CommandBindings>
        <CommandBinding Command="{x:Static local:UMLCommands.AddInitialState}"
                        Executed="AddInitialStateExecuted"/>
        <CommandBinding Command="{x:Static local:UMLCommands.AddFinalState}"
                        Executed="AddFinalStateExecuted"/>
        <CommandBinding Command="{x:Static local:UMLCommands.AddActivity}"
                        Executed="AddActivityExecuted"/>
        <CommandBinding Command="{x:Static local:UMLCommands.AddDecision}"
                        Executed="AddDecisionExecuted"/>
        <CommandBinding Command="{x:Static local:UMLCommands.AddArrow}"
                        Executed="AddArrowExecuted" CanExecute="AddArrowCanExecute"/>
        <CommandBinding Command="{x:Static local:UMLCommands.DeleteElement}"
                        Executed="DeleteElementExecuted" CanExecute="DeleteElementCanExecute"/>
        <CommandBinding Command="Undo"
                        Executed="UndoExecuted" CanExecute="UndoExecutedCanExecute"/>
        <CommandBinding Command="Redo"
                        Executed="RedoExecuted" CanExecute="RedoExecutedCanExecute"/>
        <CommandBinding Command="Save"
                        Executed="saveDialog"/>
        <CommandBinding Command="Open"
                        Executed="loadDialog"/>
        <CommandBinding Command="New"
                        Executed="newDialog"/>
        <CommandBinding Command="Print"
                        Executed="UMLPrint"/>
        <CommandBinding Command="{x:Static local:UMLCommands.HELP}" 
                        Executed="helpExecuted"/>
        <CommandBinding Command="{x:Static local:UMLCommands.About}" 
                        Executed="aboutExecuted"/>
        <CommandBinding Command="{x:Static local:UMLCommands.Exit}"
                        Executed="exitExecuted" />
    </Window.CommandBindings>
    
    <Window.InputBindings>
        <KeyBinding Command="{x:Static local:UMLCommands.DeleteElement}"  Key="Del" />
        <KeyBinding Command="Save"  Key="S" Modifiers="Ctrl"/>
        <KeyBinding Command="Undo"  Key="Z" Modifiers="Ctrl"/>
        <KeyBinding Command="Redo"  Key="Y" Modifiers="Ctrl"/>
        <KeyBinding Command="New"  Key="N" Modifiers="Ctrl"/>
        <KeyBinding Command="Print"  Key="P" Modifiers="Ctrl"/>
        <KeyBinding Command="{x:Static local:UMLCommands.DeleteElement}"  Key="del"/>
        <KeyBinding Command="{x:Static local:UMLCommands.AddArrow}"  Key="A" Modifiers="Ctrl"/>
        <KeyBinding Command="{x:Static local:UMLCommands.AddActivity}"  Key="C" Modifiers="Ctrl"/>
        <KeyBinding Command="{x:Static local:UMLCommands.HELP}"  Key="F5"/>

    </Window.InputBindings>

        <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="File">
                <MenuItem  Header="New..." Command="New">
                    <MenuItem.Icon>
                        <Image Source="Images/New Document.png" Width="16" Height="16"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Open..." Command="Open">
                    <MenuItem.Icon>
                        <Image Source="Images/Folder.png" Width="16" Height="16"/>
                    </MenuItem.Icon>
                </MenuItem>
                <Separator/>
                <MenuItem Header="Save" Command="Save">
                    <MenuItem.Icon>
                        <Image Source="Images/Save.png" Width="16" Height="16"/>
                    </MenuItem.Icon>
                </MenuItem>
                <Separator/>
                <MenuItem Header="Print" Command="Print">
                    <MenuItem.Icon>
                        <Image Source="Images/Print.png" Width="16" Height="16"/>
                    </MenuItem.Icon>
                </MenuItem>
                <Separator/>
                <MenuItem Header="Exit" Command="{x:Static local:UMLCommands.Exit}">
                    <MenuItem.Icon>
                        <Image Source="Images/Exit.png" Width="16" Height="16"/>
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
            <MenuItem Header="Edit">
                <MenuItem Header="Undo" Command="Undo">
                    <MenuItem.Icon>
                        <Image Source="Images/Undo.png" Width="16" Height="16"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="Redo" Command="Redo">
                    <MenuItem.Icon>
                        <Image Source="Images/Redo.png" Width="16" Height="16"/>
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
            <MenuItem Header="Help">
                <MenuItem Header="UML Editor help" Command="{x:Static local:UMLCommands.HELP}">
                    <MenuItem.Icon>
                        <Image Source="Images/Help book.png" Width="16" Height="16"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="About UML Editor" Command="{x:Static local:UMLCommands.About}">
                    <MenuItem.Icon>
                        <Image Source="Images/Info.png" Width="16" Height="16"/>
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
        </Menu>
        <ToolBarTray DockPanel.Dock="Top">
            <ToolBar Band="1" BandIndex="1">
                <Button Command="local:UMLCommands.AddInitialState" ToolTip="Add new initial state to diagram">
                    <StackPanel>
                        <TextBlock>Initial State</TextBlock>
                        <Image Source="Images/Add.png" Width="24" Height="24"/>
                    </StackPanel>
                </Button>
                <Button Command="local:UMLCommands.AddActivity" ToolTip="Add new activity to diagram">
                    <StackPanel>
                        <TextBlock>Activity</TextBlock>
                        <Image Source="Images/Add.png" Width="24" Height="24"/>
                    </StackPanel>
                </Button>
                <Button Command="local:UMLCommands.AddDecision" ToolTip="Add new decision to diagram">
                    <StackPanel>
                        <TextBlock>Decision</TextBlock>
                        <Image Source="Images/Add.png" Width="24" Height="24"/>
                    </StackPanel>
                </Button>
                <Button Command="local:UMLCommands.AddFinalState" ToolTip="Add new final state to diagram">
                    <StackPanel>
                        <TextBlock>Final State</TextBlock>
                        <Image Source="Images/Add.png" Width="24" Height="24"/>
                    </StackPanel>
                </Button>
                <Button ToolTip="Add new arrow to diagram"  Command="local:UMLCommands.AddArrow">
                    <StackPanel>
                        <TextBlock>Arrow</TextBlock>
                        <Image Source="Images/Left-right.png" Width="24" Height="24"/>
                    </StackPanel>
                </Button>
                <Button ToolTip="Delete Selected Item"  Command="local:UMLCommands.DeleteElement">
                    <StackPanel>
                        <TextBlock>Delete</TextBlock>
                        <Image Source="Images/Delete.png" Width="24" Height="24"/>
                    </StackPanel>
                </Button>
            </ToolBar>
            <ToolBar Band="1" BandIndex="2">
                <Button Command="Undo" ToolTip="Undo last action">
                    <StackPanel>
                        <TextBlock>Undo</TextBlock>
                        <Image Source="Images/Undo.png" Width="24" Height="24"/>
                    </StackPanel>
                </Button>
                <Button Command="Redo" ToolTip="Redo last action">
                    <StackPanel>
                        <TextBlock>Redo</TextBlock>
                        <Image Source="Images/Redo.png" Width="24" Height="24"/>
                    </StackPanel>
                </Button>
            </ToolBar>
        </ToolBarTray>
        <StatusBar DockPanel.Dock="Bottom">
            <StatusBarItem>
                <TextBlock>Ready</TextBlock>
            </StatusBarItem>
        </StatusBar>
        <Grid Name="WrapGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*" MinWidth="150" MaxWidth="250"/>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="4*" MinWidth="400"/>
            </Grid.ColumnDefinitions>
            <GridSplitter Grid.Column="1" HorizontalAlignment="Center"  VerticalAlignment="Stretch" Width="5" />
            
            <Grid Name="drawGrid" Grid.Column="2">
                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                <Border x:Name="CanvasBorder" BorderThickness="1" BorderBrush="Black">
                    <Grid Name="drawGrid2">
                            
                    </Grid>
                </Border>
                </ScrollViewer>
            </Grid>
            
            <StackPanel Margin="2" Height="200" VerticalAlignment="Top">
                <Label Content="Object Properties"/>
                <Grid Name="PropertyGrid" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition Width="5*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="20"/>
                        <RowDefinition Height="20"/>
                    </Grid.RowDefinitions>
                    <TextBlock Name="FocusName" Text="Name:" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                    <TextBox Name="FocusNameValue" Text="{Binding Path=Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" />
                </Grid>
            </StackPanel>
        </Grid>
        

    </DockPanel>
    
</Window>

